define(function(require){
	var $ = require("jq");
	var PZ_Dialog=require("pz_use_dialog.js");
	require("../css/pz-dialog.css");
	$('#select1').bind('click',function(){
		$.get("/chromosphere/doubleChromosphere.do",{},function(resultSet){
			var array = eval("("+resultSet+")");
			
			var number_dom = $('.numbers');
			var t = "";
			for ( var i = 0; i < array.length; i++) {
				if(i == 6){
					t += "<span class='num blue'>"+array[i]+"</span>";
				}else{
					t += "<span class='num red'>"+array[i]+"</span>";
				}
			}
			number_dom.html(t);
		});
	});
	
	$('#submitCp').bind('click',function(){
		var s ="",rs='';
		$.each($('.numbers span'), function(i, n){
			 if(i == 5){
				 s += parseInt($(n).html()) + "+";
			 }else if(i == 6){
				 s += parseInt($(n).html());
			 }else{
				 s += parseInt($(n).html()) + ",";
			 }
		});
        for (var i = 0, len = s.length; i < len; i++) {
              rs += (i == 0 ? "" : ",") + parseInt(s.charCodeAt(i));
        }
		var tips=new PZ_Dialog({
			  type:"confirm",
			  height:107,
			  text:'温馨提示',
			  tipsText:"品质365彩票业务是与中国足彩网建立的长期合作，当您购买彩票时，<font style='color:red'>您还需注册中国足球彩账户。</font>",
			  buttonSureText:"确定", 
			  buttonCancelText:"取消", 
			  mask:0.3,
			  callBack:function(){         //回调函数
				  var link = "http://caipiao.pinzhi365.com/lottery/ssq/index.jsp?p=0001&c="+rs+"&u=1";
			      window.open(link);
			  },
			  isDrag:true                // 开起拖动
		});
	});
});